VERSION 5.00 Begin VB.Form frmAppActivate AutoRedraw = -1 'True Caption = "Topic :" ClientHeight = 2940 ClientLeft = 4560 ClientTop = 1635 ClientWidth = 4965 LinkTopic = "Form1" ScaleHeight = 196 ScaleMode = 3 'Pixel ScaleWidth = 331 Attribute VB_Name = "frmAppActivate" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False Option Explicit ' used to determine whether or not this demo is running in the IDE Private Declare Function GetClassName& Lib "user32" Alias "GetClassNameA" (ByVal hWnd&, _ ByVal lpClassName$, ByVal nMaxCount&) Private Sub Form_Load() ' position the form Move (Screen.Width \ 2) - (Width \ 2), (Screen.Height \ 3) - (Height \ 3) ' check to see of we are running in the IDE If RunningInIde Then _ MsgBox "This demo will NOT work properly when run in the IDE." & vbCrLf & _ vbCrLf & "See the ""IMPORTANT NOTE"" in the General Declarations" & vbCrLf & _ "section of the .bas module code file for more info.", vbExclamation, "App Activate Demo" End Sub Private Function RunningInIde() As Boolean Dim sClassName$, nStrLen& ' check to see where we're running in the IDE sClassName = String$(260, vbNullChar) nStrLen = GetClassName(hWnd, sClassName, Len(sClassName)) If nStrLen Then sClassName = Left$(sClassName, nStrLen) If sClassName = "ThunderForm" Then RunningInIde = True End Function